home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / blackjack1.swf / scripts / frame_12 / DoAction.as
Text File  |  2006-01-17  |  5KB  |  236 lines

  1. function addChips()
  2. {
  3.    if(chip1ValHis[0] == 1)
  4.    {
  5.       if(insurance == true)
  6.       {
  7.          placeChips(1,0,0,0);
  8.          return undefined;
  9.       }
  10.       placeChips(1,0,0,0);
  11.    }
  12.    if(chip1ValHis[0] == 2)
  13.    {
  14.       if(insurance == true)
  15.       {
  16.          placeChips(1,0,0,0);
  17.          return undefined;
  18.       }
  19.       placeChips(2,0,0,0);
  20.    }
  21.    if(chip1ValHis[0] == 3)
  22.    {
  23.       if(insurance == true)
  24.       {
  25.          placeChips(1,0,0,0);
  26.          return undefined;
  27.       }
  28.       placeChips(3,0,0,0);
  29.    }
  30.    if(chip1ValHis[0] == 4)
  31.    {
  32.       if(insurance == true)
  33.       {
  34.          placeChips(2,0,0,0);
  35.          return undefined;
  36.       }
  37.       placeChips(4,0,0,0);
  38.    }
  39.    if(chip5ValHis[0] == 1)
  40.    {
  41.       if(insurance == true)
  42.       {
  43.          placeChips(2,0,0,0);
  44.          return undefined;
  45.       }
  46.       placeChips(0,1,0,0);
  47.    }
  48.    if(chip5ValHis[0] == 2)
  49.    {
  50.       if(insurance == true)
  51.       {
  52.          placeChips(0,1,0,0);
  53.          return undefined;
  54.       }
  55.       placeChips(0,2,0,0);
  56.    }
  57.    if(chip5ValHis[0] == 3)
  58.    {
  59.       if(insurance == true)
  60.       {
  61.          placeChips(2,1,0,0);
  62.          return undefined;
  63.       }
  64.       placeChips(0,3,0,0);
  65.    }
  66.    if(chip5ValHis[0] == 4)
  67.    {
  68.       if(insurance == true)
  69.       {
  70.          placeChips(0,2,0,0);
  71.          return undefined;
  72.       }
  73.       placeChips(0,4,0,0);
  74.    }
  75.    if(chip25ValHis[0] == 1)
  76.    {
  77.       if(insurance == true)
  78.       {
  79.          placeChips(2,2,0,0);
  80.          return undefined;
  81.       }
  82.       placeChips(0,0,1,0);
  83.    }
  84.    if(chip25ValHis[0] == 2)
  85.    {
  86.       if(insurance == true)
  87.       {
  88.          placeChips(0,0,1,0);
  89.          return undefined;
  90.       }
  91.       placeChips(0,0,2,0);
  92.    }
  93.    if(chip25ValHis[0] == 3)
  94.    {
  95.       if(insurance == true)
  96.       {
  97.          placeChips(2,2,1,0);
  98.          return undefined;
  99.       }
  100.       placeChips(0,0,3,0);
  101.    }
  102.    if(chip25ValHis[0] == 4)
  103.    {
  104.       if(insurance == true)
  105.       {
  106.          placeChips(0,0,2,0);
  107.          return undefined;
  108.       }
  109.       placeChips(0,0,4,0);
  110.    }
  111.    if(chip100ValHis[0] == 1)
  112.    {
  113.       if(insurance == true)
  114.       {
  115.          placeChips(0,0,2,0);
  116.          return undefined;
  117.       }
  118.       placeChips(0,0,0,1);
  119.    }
  120.    if(chip100ValHis[0] == 2)
  121.    {
  122.       if(insurance == true)
  123.       {
  124.          placeChips(0,0,0,1);
  125.          return undefined;
  126.       }
  127.       placeChips(0,0,0,2);
  128.    }
  129. }
  130. function placeChips(Loops1, Loops5, Loops25, Loops100)
  131. {
  132.    loops = 0;
  133.    while(loops < Loops100)
  134.    {
  135.       if(insurance == true)
  136.       {
  137.          ca++;
  138.          _root.chip100_.duplicateMovieClip("chip" + ca,ca);
  139.          xValue = posChipx2[random(7)];
  140.          yvalue = posChipy2[random(6)];
  141.          setProperty("chip" + ca, _X, xValue);
  142.          setProperty("chip" + ca, _Y, yValue);
  143.       }
  144.       else
  145.       {
  146.          c++;
  147.          _root.chip100_.duplicateMovieClip("chip" + c,c);
  148.          xValue = posChipx[random(7)];
  149.          yvalue = posChipy[random(6)];
  150.          setProperty("chip" + c, _X, xValue);
  151.          setProperty("chip" + c, _Y, yValue);
  152.       }
  153.       loops++;
  154.    }
  155.    loops = 0;
  156.    while(loops < Loops25)
  157.    {
  158.       if(insurance == true)
  159.       {
  160.          ca++;
  161.          _root.chip25_.duplicateMovieClip("chip" + ca,ca);
  162.          xValue = posChipx2[random(7)];
  163.          yvalue = posChipy2[random(6)];
  164.          setProperty("chip" + ca, _X, xValue);
  165.          setProperty("chip" + ca, _Y, yValue);
  166.       }
  167.       else
  168.       {
  169.          c++;
  170.          _root.chip25_.duplicateMovieClip("chip" + c,c);
  171.          xValue = posChipx[random(7)];
  172.          yvalue = posChipy[random(6)];
  173.          setProperty("chip" + c, _X, xValue);
  174.          setProperty("chip" + c, _Y, yValue);
  175.       }
  176.       loops++;
  177.    }
  178.    loops = 0;
  179.    while(loops < Loops5)
  180.    {
  181.       if(insurance == true)
  182.       {
  183.          ca++;
  184.          _root.chip5_.duplicateMovieClip("chip" + ca,ca);
  185.          xValue = posChipx2[random(7)];
  186.          yvalue = posChipy2[random(6)];
  187.          setProperty("chip" + ca, _X, xValue);
  188.          setProperty("chip" + ca, _Y, yValue);
  189.       }
  190.       else
  191.       {
  192.          c++;
  193.          _root.chip5_.duplicateMovieClip("chip" + c,c);
  194.          xValue = posChipx[random(7)];
  195.          yvalue = posChipy[random(6)];
  196.          setProperty("chip" + c, _X, xValue);
  197.          setProperty("chip" + c, _Y, yValue);
  198.       }
  199.       loops++;
  200.    }
  201.    loops = 0;
  202.    while(loops < Loops1)
  203.    {
  204.       if(insurance == true)
  205.       {
  206.          ca++;
  207.          _root.chip1_.duplicateMovieClip("chip" + ca,ca);
  208.          xValue = posChipx2[random(7)];
  209.          yvalue = posChipy2[random(6)];
  210.          setProperty("chip" + ca, _X, xValue);
  211.          setProperty("chip" + ca, _Y, yValue);
  212.       }
  213.       else
  214.       {
  215.          c++;
  216.          _root.chip1_.duplicateMovieClip("chip" + c,c);
  217.          xValue = posChipx[random(7)];
  218.          yvalue = posChipy[random(6)];
  219.          setProperty("chip" + c, _X, xValue);
  220.          setProperty("chip" + c, _Y, yValue);
  221.       }
  222.       loops++;
  223.    }
  224. }
  225. posChipx2 = ["460","465","470","475","480","485","490"];
  226. posChipy2 = ["175","180","185","190","195","200"];
  227. chip1ValHis = new Array();
  228. chip5ValHis = new Array();
  229. chip25ValHis = new Array();
  230. chip100ValHis = new Array();
  231. chip1Val = 0;
  232. chip5Val = 0;
  233. chip25Val = 0;
  234. chip100Val = 0;
  235. insuranceSum = 0;
  236.